//
//  OrderCell.m
//  jang
//
//  Created by lee han on 23/04/2017.
//  Copyright © 2017 lee han. All rights reserved.
//

#import "OrderCell.h"
#import "UIImageView+WebCache.h"
#import "network.h"
#import "CommonView.h"

@implementation OrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _mContainView.layer.cornerRadius = 8;
    _mContainView.layer.masksToBounds = YES;
    _mContainView.layer.borderWidth = 1;
    _mContainView.layer.borderColor = [[UIColor groupTableViewBackgroundColor] CGColor];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
    
}

-(void)initWithData:(NSDictionary*)rdata productdata:(NSDictionary*)pdata{
    
    NSString* urlstr = [URLIMAGE_PRE stringByAppendingString:[pdata objectForKey:@"path"]];
    [_mImageView sd_setImageWithURL:[NSURL URLWithString:urlstr] placeholderImage:[UIImage imageNamed:@"wenhao.png"]];
    
    _mTextName.text = [pdata objectForKey:@"pname"];
    _mTextPrice.text = [NSString stringWithFormat:@"￥%@", [rdata objectForKey:@"price"]];
    _mTextStandard.text = [rdata objectForKey:@"sname"];
    
    _mTextCount.text = [rdata objectForKey:@"count"];
}

- (void) initWithData:(NSDictionary*)data {
    NSString* urlstr = [URLIMAGE_PRE stringByAppendingString:[data objectForKey:@"path"]];
    [_mImageView sd_setImageWithURL:[NSURL URLWithString:urlstr] placeholderImage:[UIImage imageNamed:@"wenhao.png"]];
    
    _mTextName.text = [data objectForKey:@"pname"];
    _mTextPrice.text = [NSString stringWithFormat:@"￥%@", [data objectForKey:@"price"]];
    _mTextStandard.text = [data objectForKey:@"sname"];
    
    _mTextCount.text = [data objectForKey:@"count"];
}

@end
